<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">
<head>
</head>
<body>
<ui:composition template="/pages/templates/layout_menu_interno.xhtml">
	<ui:define name="title_page">#{language['application.name']} - Cadastro de Usuário</ui:define>
	
	<ui:define name="title">Cadastro de Usuário</ui:define>
		
	<ui:define name="list_link">
		<li><a href="#">Home</a></li>
		<li class="active">Cadastro de Usuário</li>
	</ui:define>
	
	<ui:define name="content">
		<article>
			<h:form prependId="false" id="form" styleClass="form-horizontal">
				<div class="container">
				<div class="form-group">
					<h:outputText id="message_top" value=" "/>
					<h:message for="message_top" styleClass="form-erro-message"/>
				</div>
				</div>
				
				<div class="form-group">
					<label class="col-sm-2 control-label">Nome*:</label>
					<div class="col-sm-6">
						<h:inputText
							id="nome"
							styleClass="form-control"
							value="#{MBeanManterUsuario.usuario.nome}"
							maxlength="50"
							required="true"
							requiredMessage="Campo obrigatório" validatorMessage="Maximo de 50 caracteres">
							<f:validateLength maximum="50" />
						</h:inputText>
					</div>
					
					<span class="help-block form-erro-message">
						<h:message for="nome"/>
					</span>
				</div>
				
				<div class="form-group">
					<label class="col-sm-2 control-label">E-mail*:</label>
					<div class="col-sm-6">
						<h:inputText
							id="email"
							styleClass="form-control"
							value="#{MBeanManterUsuario.usuario.email}"
							maxlength="50"
							required="true"
							requiredMessage="Campo obrigatório" validatorMessage="Maximo de 50 caracteres">
							<f:validateLength maximum="50" />
						</h:inputText>
					</div>
					
					<span class="help-block form-erro-message">
						<h:message for="email"/>
					</span>
				</div>
				
				<div class="form-group">
					<label class="col-sm-2 control-label">Usuário*:</label>
					<div class="col-sm-4">
						<h:inputText
							id="login"
							styleClass="form-control"
							value="#{MBeanManterUsuario.usuario.login}"
							maxlength="50"
							required="true"
							requiredMessage="Campo obrigatório" validatorMessage="Maximo de 50 caracteres">
							<f:validateLength maximum="50" />
						</h:inputText>
					</div>
					
					<span class="help-block form-erro-message">
						<h:message for="login"/>
					</span>
				</div>
				
				<div class="form-group">
					<label class="col-sm-2 control-label">Senha*:</label>
					<div class="col-sm-4">
						<h:inputSecret
							id="senha"
							styleClass="form-control"							 
							value="#{MBeanManterUsuario.usuario.senha}"
							maxlength="50"
							required="true"
							requiredMessage="Campo obrigatório" validatorMessage="Maximo de 50 caracteres">
							<f:validateLength maximum="50" />
						</h:inputSecret>
					</div>
					
					<span class="help-block form-erro-message">
						<h:message for="senha"/>
					</span>
				</div>
				
				<div class="form-group">
					<label class="col-sm-2 control-label">Confirme a Senha*:</label>
					<div class="col-sm-4">
						<h:inputSecret
							id="confirmaSenha"
							styleClass="form-control"
							value="#{MBeanManterUsuario.confirmaSenha}"
							maxlength="50"
							required="true"
							requiredMessage="Campo obrigatório" validatorMessage="Maximo de 50 caracteres">
							<f:validateLength maximum="50" />
						</h:inputSecret>
					</div>
					
					<span class="help-block form-erro-message">
						<h:message for="confirmaSenha"/>
					</span>
				</div>
				
				<div class="form-group">
					<label class="col-sm-2 control-label">Perfil*:</label>
					<div class="col-sm-4">
						<h:selectOneMenu
							id="perfil"
							styleClass="form-control"
							value="#{MBeanManterUsuario.perfil}"
							required="true"
							requiredMessage="Campo obrigatório">
							<f:selectItem itemValue="" itemLabel=" -- Selecione -- "/>
							<f:selectItems value="#{MBeanManterUsuario.perfis}"
								var="perfil" itemValue="#{perfil}" itemLabel="#{perfil.perfilToString}"/>
							<f:converter converterId="SelectOneMenuConverter"/>
						</h:selectOneMenu>
					</div>
					
					<span class="help-block form-erro-message">
						<h:message for="perfil"/>
					</span>
				</div>
				
				<br />
				
				<div class="form-group">
				    <div class="col-sm-offset-2 col-sm-8" style="text-align: left;">
						<h:commandButton styleClass="btn btn-two" value="Salvar"
							action="#{MBeanManterUsuario.actionSalvar}"/>
						<h:commandButton styleClass="btn btn-two" value="Cancelar"
							style="margin-left: 10px;"
							action="#{MBeanManterUsuario.actionCancelarCadastro}"
							immediate="true"/>
					</div>
				</div>
			</h:form>
		</article>
	</ui:define>
</ui:composition>
</body>
</html>